package practice;

import java.util.Scanner;

public class CarTes {






    public static void main(String[] args) {
        Scanner stdIn=new Scanner(System.in);
        CarPactice bmw =new CarPactice("BMW730Li领先型",1902,
                1498,5250,100);
        CarPactice jaguar =new CarPactice("XJ50",1902,1498,
                5250,100);
        bmw.show();
        System.out.println();
            while (true){
                System.out.println("当前位置("+bmw.getX()+","+bmw.getY()+")");
                System.out.println("剩余燃料"+bmw.getFuel());
                System.out.println("是否移动0----NO/1-----YES");
                if (stdIn.nextInt()==0)
                break;
                System.out.println("x方向的移动距离");
                double dx=stdIn.nextDouble();
                System.out.println("y方向的移动距离");
                double dy=stdIn.nextInt();
                if (bmw.move(dx,dy)) {
                    System.out.println("燃料足够");

                    System.out.println("此次移动消费的费用："+bmw.fuelCost(dx,dy));
                }
                else
                    System.out.println("燃料不足");

            }



    }
}
